/****************************************************************
 * Header for the 'Utils' class for utility programs.
 *
 * Author/copyright:  Duncan Buell
 * Date: 13 June 2009
 *
 * This code performs utility functions, including:
 * 1.  check for appropriate number of arguments and print an
 *     output 'usage' message if incorrect.
 * 2.  open/close input, output, and log files.
**/

#ifndef UTILS_H_
#define UTILS_H_

#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <time.h>
#include <sys/time.h>
#include <sys/resource.h>

#define LONG long long

using namespace std;

class Utils
{
public:
/****************************************************************
 * Input, output, and log streams.
**/
  static ifstream inStream;
  static ofstream outStream;
  static ofstream logStream;

/****************************************************************
 * Constructors and destructors for the class. 
**/
  Utils();
  virtual ~Utils();

/****************************************************************
 * Constructors and destructors for the class. 
**/
  static void checkArgs(int howMany, int argc, char *argv[], string usage);
  static void FileClose(ifstream& inStream);
  static void FileClose(ofstream& outStream);
  static void InFileOpen(string fileName);
  static void OutFileOpen(string fileName);
  static void LogFileOpen(string fileName);

  static void toLower(string& to, string from);

  static string timecall(string timestring);

private:
};

#endif /*UTILS_H_*/
